package com.example.semaphore;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class DateTimeMain {

    public static void main(String[] args) {
        LocalDateTime now = LocalDateTime.now();
        int hour = now.getHour();
        System.out.println(hour);
        LocalDate localDate = now.toLocalDate().withDayOfMonth(10);
        LocalDateTime localDateTime = localDate.atTime(23, 59, 59);
        String format = localDateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
        System.out.println(format);
    }

}
